According to the ICCCM spec [1], one should subtract the base size from
the window size before checking that the aspect ratio falls in range.
This change fixes shrinking Firefox Picture-in-Picture windows when
running KDE Plasma (with KWin as the window manager).
[1] https://tronche.com/gui/x/icccm/sec-4.html#s-4.1.2.3
{
gint delta;
+ if (flags & GDK_HINT_BASE_SIZE)
+ {
+ width -= base_width;
+ height -= base_height;
+ min_width -= base_width;
+ min_height -= base_height;
+ max_width -= base_width;
+ max_height -= base_height;
+ }
+
if (geometry->min_aspect * height > width)
{
delta = FLOOR (height - width / geometry->min_aspect, yinc);
height += delta;
}
}
+
+ if (flags & GDK_HINT_BASE_SIZE)
+ {
+ width += base_width;
+ height += base_height;
+ }
}
#undef FLOOR